<html>
<head>
<title>pes0001</title>
</head>
<body>
<pre>Copyright (c)  2011 Nathan Crawford.
  Permission is granted to copy, distribute and/or modify this document
  under the terms of the GNU Free Documentation License, Version 1.2
  or any later version published by the Free Software Foundation;
  with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
  Texts.  

$Id$

Most numerical values appear to be 16 bit signed ints and are shown as such in this document, unless otherwise noted.
All characters appear to be ascii.

#PES0001 (16 bytes in this section)
1. address of the PEC section start (this is a UInt32)
2. a value of 1 here seems to indicate design data is over 100KB long, or 0 for less than 100KB
3. 1 (the rest of the fields in this section appear to be always the same; they also match the ending fields of the next section)
4. 1
5. -1
6. 0
7. number of characters in the name of the next class (7 for CEmbOne)
CEmbOne (66 bytes in this section)
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22. design X offset
23. design Y offset
24. design width
25. design height
26.
27.
28.
29. 1 (the rest of the fields in this section appear to be always the same; they also match the ending fields of the previous section)
30. 1
31. -1
32. 0
33. number of characters in the name of the next class (7 for CSewSeg)
CSewSeg
Start stitch blocks 
Block:
    (color start indicator) (all color changes have the same value for this field; if the value here is not the same as the first block, it's not a color change)
    (color index)
    (number of stitches in this block)
    (x value)
    (y value)
    (x value)
    (y value)
    (x value)
    ...
    -32765 (block seperator or joiner) (03 80 in hex, 32771 as UInt16)
(block)
(block seperator)
(block)
(block seperator)
...
when you read all the stitches for a block and the next value is not a block seperator, stitch blocks are done (I think)
Start color table: 
    (color index)
    (number of blocks before next color change?)
    (color index)
    (number of blocks)
    ...
    This block ends with 0 0 (00 00 in hex)
After the color table should be 16716 (LA in char, 4C 41 in hex) which seems to signal the start of the PEC section
</pre>
</body>
</html>
